export function usePicker(position = null, show = false, selectedIcon = window?.$selectedIcon) {
  selectedIcon.show = false
  if (position) {
    if (typeof position.lng !== "undefined" && typeof position.lat !== "undefined") {
      selectedIcon.position = position
      selectedIcon.show = show
    } else if (position instanceof DE.__namespace.Cesium.Cartesian3) {
      selectedIcon.position = position
      selectedIcon.show = show
    } else if (position.isConstant || position._isConstant) {
      selectedIcon.position = position._value
      selectedIcon.show = show
    } else {
      selectedIcon.position = position.getValue(DE.__namespace.Cesium.JulianDate.now())
      selectedIcon.show = show
    }
  }
}
